<%@ Page Language="C#" MasterPageFile="~/AppSpace/Dashboard.Master" AutoEventWireup="true"
    CodeBehind="Work.aspx.cs" Inherits="SmartProject.AppSpace.WorkItem" Title="SmartProject - Work"
    ValidateRequest="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="WebControls/AddEditWork.ascx" TagName="AddEditWork" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <input id="LblWorkId" runat="server" type="hidden" />
    <cc1:ModalPopupExtender ID="PopEditWork" runat="server" TargetControlID="BtnEdit"
        PopupControlID="PnlEditWork" BackgroundCssClass="modelBackground">
    </cc1:ModalPopupExtender>
    <cc1:ModalPopupExtender ID="PopAddMessage" runat="server" TargetControlID="BtnNewMessage"
        PopupControlID="PnlMessage" BackgroundCssClass="modelBackground">
    </cc1:ModalPopupExtender>
    <cc1:ModalPopupExtender ID="PopManageAttachments" runat="server" TargetControlID="BtnManageAttachments"
        PopupControlID="PnlAttachments" BackgroundCssClass="modelBackground">
    </cc1:ModalPopupExtender>
    <div id="PnlEditWork" runat="server" style="display: none; background-color: #EEE">
        <uc1:AddEditWork ID="CtlAddEditWork" runat="server" />
    </div>
    <div id="PnlMessage" runat="server" style="display: none; background-color: #EEE">
        <table cellpadding="0" cellspacing="1" width="770px">
            <tr>
                <td style="color: #EFEFEF; font-weight: bold; font-size: 15px; background-color: #69c;
                    text-align: left;">
                    <asp:UpdatePanel ID="UpdMessageTitle" runat="server">
                        <ContentTemplate>
                            <asp:Label ID="LblMessageTitle" runat="server" Text="New Message"></asp:Label>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblError" runat="server" SkinID="ErrorLabel"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td valign="top">
                                <table>
                                    <tr>
                                        <td align="left" style="color: Blue">
                                            Attachments:&nbsp;<asp:DropDownList ID="DrpAttachments" runat="server">
                                            </asp:DropDownList>
                                            <asp:Button ID="BtnInsertAttachmentText" runat="server" Text="Insert" SkinID="StandardButton"
                                                OnClick="BtnInsertAttachmentText_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:UpdatePanel ID="UdpMessage" runat="server">
                                                <ContentTemplate>
                                                    <cc2:Editor ID="TxtNewNotes" runat="server" Height="500px" />
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                    <asp:AsyncPostBackTrigger ControlID="BtnInsertAttachmentText" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td valign="top">
                                <table>
                                    <tr>
                                        <td align="left" style="color: Blue">
                                            Receipiants:
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:UpdatePanel ID="UdpReceipiants" runat="server">
                                                <ContentTemplate>
                                                    <asp:ListBox ID="LstReceipiants" runat="server" Height="300px" Width="150px" SelectionMode="Multiple">
                                                    </asp:ListBox>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="color: Blue" align="left">
                                            <asp:UpdatePanel ID="UdpText1" runat="server">
                                                <ContentTemplate>
                                                    <asp:Label ID="LblText1" Visible="false" runat="server" Text="Actual Time:"></asp:Label>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:UpdatePanel ID="UpdActual" runat="server">
                                                <ContentTemplate>
                                                    <asp:TextBox ID="TxtActual" Visible="false" runat="server" Width="50px"></asp:TextBox>&nbsp;
                                                    <asp:DropDownList ID="DrpActual" Visible="false" runat="server" />
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="color: Blue" align="left">
                                            <asp:UpdatePanel ID="UpdText2" runat="server">
                                                <ContentTemplate>
                                                    <asp:Label ID="LblText2" Visible="false" runat="server" Text="New Status:"></asp:Label>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:UpdatePanel ID="UpdOptions" runat="server">
                                                <ContentTemplate>
                                                    <asp:DropDownList ID="DrpOptions" Visible="false" runat="server">
                                                    </asp:DropDownList>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="BtnCancelMessage" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:ImageButton ID="BtnSaveMessage" runat="server" OnClick="BtnSaveMessage_Click"
                        ImageUrl="~/Image/WorkSave.png" ToolTip="Save" />&nbsp;&nbsp;&nbsp;&nbsp;<asp:ImageButton
                            ID="BtnCancelMessage" runat="server" ImageUrl="~/Image/WorkCancel2.png" ToolTip="Cancel"
                            OnClick="BtnCancelMessage_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div id="PnlAttachments" runat="server" style="display: none; background-color: #EEE">
        <table width="550px">
            <tr>
                <td style="color: #EFEFEF; font-weight: bold; font-size: 15px; background-color: #69c;
                    text-align: left;">
                    Manage Attachments
                </td>
            </tr>
            <tr>
                <td>
                    <asp:UpdatePanel ID="UdpFileUploader" runat="server">
                        <ContentTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="FupUploader1" runat="server" Width="100%" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="FupUploader2" runat="server" Width="100%" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="FupUploader3" runat="server" Width="100%" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="FupUploader4" runat="server" Width="100%" />
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="BtnCancelSaveAttachments" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:ImageButton ID="BtnSaveAttachments" runat="server" OnClick="BtnSaveAttachments_Click"
                        ImageUrl="~/Image/WorkSave.png" ToolTip="Save" />&nbsp;&nbsp;&nbsp;&nbsp;<asp:ImageButton
                            ID="BtnCancelSaveAttachments" runat="server" ImageUrl="~/Image/WorkCancel2.png"
                            ToolTip="Cancel" OnClick="BtnCancelSaveAttachments_Click" />
                </td>
            </tr>
        </table>
    </div>
    <table width="100%">
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td align="left" valign="top">
                            <table>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Created:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblCreated" runat="server" SkinID="GreenLabel" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Assigned:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblAssigned" runat="server" SkinID="GreenLabel" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Approved:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblApproved" runat="server" SkinID="GreenLabel" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Completed:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblCompleted" runat="server" SkinID="GreenLabel" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Developer:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblDeveloperName" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Product:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblProduct" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Category:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblWorkCategory" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Sprint:
                                    </td>
                                    <td>
                                        <asp:Label ID="LblSprint" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td align="right" valign="top">
                            <table>
                                <tr>
                                    <td>
                                        <img alt="" id="ImgDaysRemaining_2" runat="server" src="~/Image/DaysRemaining.png"
                                            title="Due by" />
                                    </td>
                                    <td valign="top" style="color: Blue" align="left">
                                        Due by:<br />
                                        <asp:Label ID="LblDueByDescription" runat="server" SkinID="GreenLabel"></asp:Label><br />
                                        <asp:Label ID="LblDueBy" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <img alt="" id="ImgPriority" runat="server" src="~/Image/Priority.png" title="Priority" /><br />
                                    </td>
                                    <td valign="top" style="color: Blue" align="left">
                                        Priority:<br />
                                        <asp:Label ID="LblPriority" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Estimated time:
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="LblEst" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: Blue" align="right">
                                        Actual time:
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="LblActual" runat="server" SkinID="GreenLabel"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="left">
                            <div class="clean-gray" style="text-align: left; width: 100%">
                                <img alt="" src="../Image/Desc.png" />
                                <asp:Label ID="LblOwner" runat="server" Text='<%# Eval("OwnerName") %>' SkinID="GreenLabel"></asp:Label>:
                                <asp:Label ID="LblDescText" runat="server"></asp:Label>
                            </div>
                        </td>
                        <td align="right">
                            <asp:ImageButton ID="BtnEdit" runat="server" ImageUrl="~/Image/WorkEditButton.png"
                                ToolTip="Edit" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%" style="color: Blue">
                    <tr>
                        <td align="left" valign="top">
                        </td>
                        <td align="right" valign="top">
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="BtnUpdateStatus" runat="server" ImageUrl="~/Image/UpdateStatus.png"
                                            ToolTip="Update Status" OnClick="BtnUpdateStatus_Click" />
                                        &nbsp;&nbsp;<asp:ImageButton ID="BtnNewMessage" runat="server" ImageUrl="~/Image/Add.png"
                                            ToolTip="New message" />&nbsp;&nbsp;
                                        <asp:ImageButton ID="BtnManageAttachments" runat="server" ImageUrl="~/Image/Attachment.png"
                                            ToolTip="Add attachment" />
                                        &nbsp;&nbsp;<asp:ImageButton ID="BtnDelete" runat="server" ImageUrl="~/Image/WorkDelete.png"
                                            ToolTip="Delete" OnClick="BtnDelete_Click" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:DropDownList ID="DrpAttachmentsDownload" runat="server">
                                        </asp:DropDownList>
                                        &nbsp;<asp:Button ID="BtnDownload" runat="server" Text="Download" SkinID="StandardButton"
                                            OnClick="BtnDownload_Click" />
                                        &nbsp;<asp:Button ID="BtnRemoveAttachment" runat="server" SkinID="StandardButton"
                                            Text="Remove" OnClick="BtnRemoveAttachment_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:ListView ID="LstMessages" runat="server">
                    <LayoutTemplate>
                        <asp:DataPager runat="server" ID="DpgMessages" PageSize="5" OnPreRender="DpgNotes_PreRender">
                            <Fields>
                                <asp:NumericPagerField ButtonCount="5" PreviousPageText="<--" NextPageText="-->" />
                            </Fields>
                        </asp:DataPager>
                        <table runat="server" id="TblNotes" cellpadding="0" cellspacing="1" width="100%">
                            <tr runat="server" id="itemPlaceholder">
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <input id="PlcMessageId" type="hidden" runat="server" value='<%#Eval("MessageId") %>' />
                        <tr id="Tr1" runat="server">
                            <td align="left">
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <div class="clean-gray" style="text-align: left; color: Green">
                                                On
                                                <asp:Label ID="LblNoteInfo1" runat="server" Text='<%#Eval("Created") %>'></asp:Label>,&nbsp;<asp:Label
                                                    ID="LblNoteInfo2" runat="server" Text='<%#Eval("OwnerName") %>'></asp:Label>
                                                wrote:
                                            </div>
                                        </td>
                                        <td align="right">
                                            <asp:ImageButton ID="BtnRemoveMessage" runat="server" CommandArgument='<%#Eval("MessageId") %>'
                                                ImageUrl="~/Image/WorkDelete.png" OnClick="BtnRemoveMessage_Click" ToolTip="Delete Message" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr2" runat="server">
                            <td>
                                <asp:Label ID="LblDescription" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>
            </td>
        </tr>
    </table>
</asp:Content>
